﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace oAuthDemo.OpenIDProvider.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            // We can setup this to any action.
            // http://localhost/oAuthDemosOpenIDProvider/OpenID/Xrds
            if (Request.AcceptTypes.Contains("application/xrds+xml"))
            {
                ViewData["OPIdentifier"] = true;
                return PartialView("Xrds"); // no layout and master page.
            } 

            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";

            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        public ActionResult Xrds()
        {
            ViewData["OPIdentifier"] = true;
            return PartialView();
        }
    }
}
